﻿// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="Program.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the Program type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
namespace FacebookTest
{
    using System.Collections.ObjectModel;
    using System.Configuration;
    using Facebook.Core.Contracts;
    using Facebook.Core.Responses;
    using Facebook.Fluent;
    using Facebook.Fluent.Fields;

    /// <summary>
    /// Main entry point for scratch pad application to test API while debugging.
    /// </summary>
    public class Program
    {
        /// <summary>
        /// Main entry point.
        /// </summary>
        private static void Main()
        {
            IFacebookService facebookService =
                FB.For(ConfigurationManager.AppSettings["apiKey"], ConfigurationManager.AppSettings["secretKey"])
                .With(new FacebookSessionManager())
                    .Build;

            Collection<status> statuses = Select.All<Status>()
                .From<status>()
                .Where(Status.time).Gt(1235775000)
                .And(Status.uid).In(
                Select.Columns(Friend.uid1)
                    .From<friend>()
                    .Where(Friend.uid2).Eq(200903070)
                )
                .Execute(facebookService);


//            Collection<friend> friends = FBSQL.With(facebookService)
//                .Select(Friend.uid1)
//                .From<friend>()
//                .Where(Friend.uid2).Eq(200903070);
//
//            Collection<user> query = FBSQL
//                .With(facebookService)
//                .SelectAll<User>()
//                .From<user>()
//                .Where(User.uid).Eq(656553988);
        }

    }
}
